import { Routes, Route } from "react-router-dom";
import Home from "@/pages/Home";
import XiaohongshuCover from "@/pages/XiaohongshuCover";
import HenanMuseumCover from "@/pages/HenanMuseumCover";
import LuoyangMuseumCover from "@/pages/LuoyangMuseumCover";
import JadeCong from "@/pages/JadeCong";
import BronzeHu from "@/pages/BronzeHu";
import GoldBeast from "@/pages/GoldBeast";
import SilverThreadJadeSuit from "@/pages/SilverThreadJadeSuit";
import GoldSeal from "@/pages/GoldSeal";
import SilverInlaidOxLamp from "@/pages/SilverInlaidOxLamp";
import GildedBeastBoxInkstone from "@/pages/GildedBeastBoxInkstone";
import CeladonDivineBeastZun from "@/pages/CeladonDivineBeastZun";
import BambooGroveSagesBrickPainting from "@/pages/BambooGroveSagesBrickPainting";
import GlazedRedPlumVase from "@/pages/GlazedRedPlumVase";
import GoldenCicadaJadeLeaf from "@/pages/GoldenCicadaJadeLeaf";
import GoldGuanyin from "@/pages/GoldGuanyin";
import GildedLamaPagoda from "@/pages/GildedLamaPagoda";
import BlueAndWhiteIncenseBurner from "@/pages/BlueAndWhiteIncenseBurner";
import MiscellaneousFlowersScroll from "@/pages/MiscellaneousFlowersScroll";
import WorldMap from "@/pages/WorldMap";
import JesusEmbroidery from "@/pages/JesusEmbroidery";
import JiahuBoneFlute from "@/pages/JiahuBoneFlute";
import DulingSquareDing from "@/pages/DulingSquareDing";
import FuHaoOwlZun from "@/pages/FuHaoOwlZun";
import JadeHandledIronSword from "@/pages/JadeHandledIronSword";
import LotusAndCraneSquareHu from "@/pages/LotusAndCraneSquareHu";
import FourGodsCloudPatternPainting from "@/pages/FourGodsCloudPatternPainting";
import WuZetianGoldenSlip from "@/pages/WuZetianGoldenSlip";
import RuKilnSkyBlueGlazeVase from "@/pages/RuKilnSkyBlueGlazeVase";
import CloudPatternBronzeJin from "@/pages/CloudPatternBronzeJìn";
import RuDingWenTongJue from "@/pages/RuDingWenTongJue";
import CaoWeiBaiYuBei from "@/pages/CaoWeiBaiYuBei";
import SanCaiHeiYouMa from "@/pages/SanCaiHeiYouMa";
import DongHanShiBiXie from "@/pages/DongHanShiBiXie";
import JinSiNanMuTa from "@/pages/JinSiNanMuTa";
import XiZhouShouMianWenTongFangDing from "@/pages/XiZhouShouMianWenTongFangDing";
import BeiWeiNiSuFoMianXiang from "@/pages/BeiWeiNiSuFoMianXiang";
import XiangQianLvSongShiTongPaiShi from "@/pages/XiangQianLvSongShiTongPaiShi";
import { useState } from "react";
import { AuthContext } from '@/contexts/authContext';
import Sidebar from '@/components/Sidebar';

export default function App() {
  const [isAuthenticated, setIsAuthenticated] = useState(false);
  const [sidebarOpen, setSidebarOpen] = useState(true);

  const logout = () => {
    setIsAuthenticated(false);
  };

  const toggleSidebar = () => {
    setSidebarOpen(!sidebarOpen);
  };

  return (
    <AuthContext.Provider
      value={{ isAuthenticated, setIsAuthenticated, logout }}
    >
        <div className="flex min-h-screen bg-gray-50 relative before:content-['石头妈妈'] before:fixed before:top-0 before:left-0 before:w-full before:h-full before:flex before:items-center before:justify-center before:text-[10rem] before:text-gray-300 before:opacity-5 before:pointer-events-none before:rotate-[-15deg] before:z-0">
        <Sidebar isOpen={sidebarOpen} onToggle={toggleSidebar} />
        
        <main className={`flex-1 transition-all duration-300 ${sidebarOpen ? 'ml-64' : 'ml-16'} print:ml-0`}>
          <Routes>
            <Route path="/" element={<Home />} />
            <Route path="/xiaohongshu-cover" element={<XiaohongshuCover />} />
            <Route path="/henan-museum-cover" element={<HenanMuseumCover />} />
            <Route path="/luoyang-museum-cover" element={<LuoyangMuseumCover />} />
            <Route path="/jade-cong" element={<JadeCong />} />
            <Route path="/bronze-hu" element={<BronzeHu />} />
      <Route path="/gold-beast" element={<GoldBeast />} />
      <Route path="/silver-jade-suit" element={<SilverThreadJadeSuit />} />
      <Route path="/gold-seal" element={<GoldSeal />} />
       <Route path="/silver-inlaid-ox-lamp" element={<SilverInlaidOxLamp />} />
        <Route path="/gilded-beast-box-inkstone" element={<GildedBeastBoxInkstone />} />
        <Route path="/celadon-divine-beast-zun" element={<CeladonDivineBeastZun />} />
         <Route path="/bamboo-grove-sages-brick-painting" element={<BambooGroveSagesBrickPainting />} />
         <Route path="/glazed-red-plum-vase" element={<GlazedRedPlumVase />} />
          <Route path="/golden-cicada-jade-leaf" element={<GoldenCicadaJadeLeaf />} />
          <Route path="/gold-guanyin" element={<GoldGuanyin />} />
          <Route path="/gilded-lama-pagoda" element={<GildedLamaPagoda />} />
          <Route path="/blue-and-white-incense-burner" element={<BlueAndWhiteIncenseBurner />} />
            <Route path="/other" element={<div className="text-center text-xl">Other Page - Coming Soon</div>} />
            <Route path="/miscellaneous-flowers-scroll" element={<MiscellaneousFlowersScroll />} />
            <Route path="/world-map" element={<WorldMap />} />
            <Route path="/jesus-embroidery" element={<JesusEmbroidery />} />
            <Route path="/jiahu-bone-flute" element={<JiahuBoneFlute />} />
            <Route path="/duling-square-ding" element={<DulingSquareDing />} />
            <Route path="/fu-hao-owl-zun" element={<FuHaoOwlZun />} />
            <Route path="/jade-handled-iron-sword" element={<JadeHandledIronSword />} />
            <Route path="/lotus-and-crane-square-hu" element={<LotusAndCraneSquareHu />} />
            <Route path="/four-gods-cloud-pattern-painting" element={<FourGodsCloudPatternPainting />} />
            <Route path="/wu-zetian-golden-slip" element={<WuZetianGoldenSlip />} />
            <Route path="/ru-kiln-sky-blue-glaze-vase" element={<RuKilnSkyBlueGlazeVase />} />
             <Route path="/cloud-pattern-bronze-jin" element={<CloudPatternBronzeJin />} />
            {/* 洛阳博物馆文物路由 */}
            <Route path="/ru-ding-wen-tong-jue" element={<RuDingWenTongJue />} />
            <Route path="/cao-wei-bai-yu-bei" element={<CaoWeiBaiYuBei />} />
            <Route path="/san-cai-hei-you-ma" element={<SanCaiHeiYouMa />} />
            <Route path="/dong-han-shi-bi-xie" element={<DongHanShiBiXie />} />
            <Route path="/jin-si-nan-mu-ta" element={<JinSiNanMuTa />} />
            <Route path="/xi-zhou-shou-mian-wen-tong-fang-ding" element={<XiZhouShouMianWenTongFangDing />} />
            <Route path="/bei-wei-ni-su-fo-mian-xiang" element={<BeiWeiNiSuFoMianXiang />} />
            <Route path="/xiang-qian-lv-song-shi-tong-pai-shi" element={<XiangQianLvSongShiTongPaiShi />} />
          </Routes>
        </main>
      </div>
    </AuthContext.Provider>
  );
}